package ysq.xyg.${module}.model.po;

import lombok.NoArgsConstructor;

import lombok.Data;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;
import ysq.xyg.sys.model.po.SysUser;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * ${tableComment}实体类
 *
 * @author ${author}
 * @date ${.now}
 */
@Data
@NoArgsConstructor
@Table(name = "${table.sqlName}")
public class ${entity} implements Serializable{

	<#list table.columns as column>
	/**
     * ${column.columnAlias}
     */ 
	<#if column.pk>
	@Id
	<#else>
	@Column(name = "${column.sqlName}")
	</#if>
	private ${column.javaType} ${column.columnNameLower};

	</#list>

	public ${entity}(SysUser sysUser) {
		this.id= BaseUtil.uId();
		this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}